package com.xiaojiezhu.netty.base.protocol;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;


/**
 * 作者 zxj<br>
 * 时间 2017/7/14 17:00
 * 说明 ...
 */
public class DefaultServerChannelHandler extends ChannelInitializer<SocketChannel> {
    protected void initChannel(SocketChannel ch) throws Exception {
        //添加自定义的编码解码工具
        ch.pipeline().addLast(new CobraEncoder());
        ch.pipeline().addLast(new CobraDecoder());
        //处理网络IO
        ch.pipeline().addLast(new ServerHandler());
    }
}
